package com.dailyblue.example.spring.boot.seckill.controller;

import com.dailyblue.example.spring.boot.commons.util.JsonResult;
import com.dailyblue.example.spring.boot.seckill.service.SeckillService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/seckill")
public class SeckillController {
    @Resource
    private SeckillService service;

    @GetMapping("/{user}")
    public JsonResult seckill(@PathVariable String user) {
        return service.seckill(user);
    }
}
